import java.util.ArrayList;
enum Gender {
	male,
	female
}
class Person {
	String name;
	Gender gender; 
	int age;
	ArrayList<Person> a=new ArrayList<Person>();
	Person(String name, Gender gender, int age) {
		this.name = name;
		this.gender = gender;
		this.age = age;
	}

	Person(String name, Gender gender, int age, ArrayList<Person> a) {
		this(name, gender, age);
		this.a = a;	
	}
	
	String getName() {
		return name;
	}

	int getAge() {
		return age;
	}

	void increaseAge() {
		age++;
	}

	ArrayList<Person> getChildren() {
		return a;
	} 

	void setChildren(Person []children) {
		for(int i=0;i<children.length;i++)
		    a.add(children[i]);
	}

	void addChild(Person child) {
			a.add(child);
	}

	public String toString() {
		String desc = "Name: " + name+ "\nGender: " + gender+ "\nAge: " + age;
		if (a.size()!=0)
			desc += "\nChildren numbers: " + a.size();
		return desc;
		
	}
}
public class Main {
	public static void main(String[] args) {
		Person tom = new Person("Tom", Gender.male, 43);
		Person marry = new Person("Marry", Gender.female, 10);
		Person tony = new Person("Tony", Gender.male, 3);
		tom.addChild(marry);
		tom.addChild(tony);
		System.out.println(tom);
		System.out.println("Tom's children:");		
		for (Person child : tom.getChildren()) {
			System.out.println(child);
		}
		Person zhang3 = new Person("Zhang3", Gender.male, 40);
		Person childrenOfZhang3[] = {new Person("ZhangGG", Gender.male, 8), new Person("ZhangMM", Gender.male, 6)}; 
		zhang3.setChildren(childrenOfZhang3);
		System.out.println(zhang3);
		System.out.println("Zhang3's children:");
		for (Person child : zhang3.getChildren()) {
			System.out.println(child);
		}
	}
}